package com.authenticateCenter.util;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author 大忽悠
 * @create 2022/10/9 19:32
 */
public class StringUtil {
    public static final String DELIMITER =",";

    public static List<Integer> strIdToListInt(String strId){
        return Arrays.stream(strId.split(DELIMITER)).map(Integer::valueOf).collect(Collectors.toList());
    }

    public static boolean isNullOrEmpty(String value) {
        if(value==null){
            return true;
        }
        return value.trim().isEmpty() || "".equals(value) || "\"\"".equals(value.trim());
    }

    public static List<String> strNameToListName(String roleNameList) {
        return Arrays.stream(roleNameList.split(DELIMITER)).collect(Collectors.toList());
    }
}
